package day07;

public class txt12 {
    public static void main(String[] args) {
        int[]arr={5,9,3,6,2};
        getmax(arr);
        System.out.println(arr[4]);
    }
    static void getmax(int[]arr){
        for (int i = 0; i < arr.length-1; i++) {
            if(arr[i]>arr[i+1]){
                int a=arr[i];
                arr[i]=arr[i+1];
                arr[i+1]=a;
            }

        }
    }
}
